﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="PS_AbsenceInforms.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_AbsenceInforms" %>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">    
    <link href="../../Styles/CssClass.css" rel="cssClass" type="text/css" />
    <link href="../../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
    
    <title>บันทึกใบลา</title>
    <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">        
        <script type="text/javascript">
            function closeRadWindow(sender, args) {
                $find("<%= RadManager1.ClientID %>").ajaxRequest('CloseWindow');
            }
            function onTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }
            function isNumberKeyDot(event)  // ตัวเลขทศนิยม
            {
                var charCode = (event.which) ? event.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46) {
                    alert("กรอกได้เฉพาะตัวเลขและทศนิยม!")
                    return false;
                }
                return true;
            }
            function SeqClick(seq) {
                var hiddenElement = document.getElementById("<%= hdSequence.ClientID %>");
                hiddenElement.value = seq;
                $find("<%= RadManager1.ClientID %>").ajaxRequest(seq);
            }
                       
            function setCalendarDateStartTable() {
                var tooltip = $find("<%= ToolTipDateStart.ClientID %>");
                var calendar = $find("<%= CalendarDateStart.ClientID %>");
                var fastNavigation = calendar._getFastNavigation();
                fastNavigation.OnToday =
                        function() {
                            var today = new Date;
                            var date = [today.getFullYear(), today.getMonth() + 1, today.getDate()];
                            calendar.selectDate(date, true);
                            fastNavigation.Popup.Hide();
                            var all_date = date.toString().split(",");
                            var year = parseInt(all_date[0]) + 543;
                            var month = all_date[1];
                            var day = all_date[2];
                            if (day.length == 1) {
                                day = '0' + day;
                            }
                            if (month.length == 1) {
                                month = '0' + month;
                            }

                            var maskText = $find("<%= txtDateStart.ClientID %>");
                            maskText.set_value(day + month + year);
                            tooltip.hide();
                        }
            }
            function OnCalendarDateStartClick(calendarInstance, args) {
                var tooltip = $find("<%= ToolTipDateStart.ClientID %>");
                var fastNavigation = calendarInstance._getFastNavigation();
                var date = args.get_renderDay().get_date().toString();
                var all_date = date.split(",");
                var year = parseInt(all_date[0]) + 543;
                var month = all_date[1];
                var day = all_date[2];
                if (day.length == 1) {
                    day = '0' + day;
                }
                if (month.length == 1) {
                    month = '0' + month;
                }

                var maskText = $find("<%= txtDateStart.ClientID %>");
                maskText.set_value(day + month + year);
                tooltip.hide();
            }
            function OnCalendarDateStartViewChanged(sender, step) {
                var year = parseInt(sender.FocusedDate[0]) + 543;
                var month = sender.FocusedDate[1];
                document.getElementById("CalendarDateStart_Title").innerHTML = changeMonthNumberToName(month) + " " + year;
            }
            
            function setCalendarDateEndTable() {
                var tooltip = $find("<%= ToolTipDateEnd.ClientID %>");
                var calendar = $find("<%= CalendarDateEnd.ClientID %>");
                var fastNavigation = calendar._getFastNavigation();
                fastNavigation.OnToday =
                        function() {
                            var today = new Date;
                            var date = [today.getFullYear(), today.getMonth() + 1, today.getDate()];
                            calendar.selectDate(date, true);
                            fastNavigation.Popup.Hide();
                            var all_date = date.toString().split(",");
                            var year = parseInt(all_date[0]) + 543;
                            var month = all_date[1];
                            var day = all_date[2];
                            if (day.length == 1) {
                                day = '0' + day;
                            }
                            if (month.length == 1) {
                                month = '0' + month;
                            }

                            var maskText = $find("<%= txtDateEnd.ClientID %>");
                            maskText.set_value(day + month + year);
                            tooltip.hide();
                        }
            }
            function OnCalendarDateEndClick(calendarInstance, args) {
                var tooltip = $find("<%= ToolTipDateEnd.ClientID %>");
                var fastNavigation = calendarInstance._getFastNavigation();
                var date = args.get_renderDay().get_date().toString();
                var all_date = date.split(",");
                var year = parseInt(all_date[0]) + 543;
                var month = all_date[1];
                var day = all_date[2];
                if (day.length == 1) {
                    day = '0' + day;
                }
                if (month.length == 1) {
                    month = '0' + month;
                }

                var maskText = $find("<%= txtDateEnd.ClientID %>");
                maskText.set_value(day + month + year);
                tooltip.hide();
            }
            function OnCalendarDateEndViewChanged(sender, step) {
                var year = parseInt(sender.FocusedDate[0]) + 543;
                var month = sender.FocusedDate[1];
                document.getElementById("CalendarDateEnd_Title").innerHTML = changeMonthNumberToName(month) + " " + year;
            }
            
            function setCalendarDateApprovedTable() {
                var tooltip = $find("<%= ToolTipDateApproved.ClientID %>");
                var calendar = $find("<%= CalendarDateApproved.ClientID %>");
                var fastNavigation = calendar._getFastNavigation();
                fastNavigation.OnToday =
                        function() {
                            var today = new Date;
                            var date = [today.getFullYear(), today.getMonth() + 1, today.getDate()];
                            calendar.selectDate(date, true);
                            fastNavigation.Popup.Hide();
                            var all_date = date.toString().split(",");
                            var year = parseInt(all_date[0]) + 543;
                            var month = all_date[1];
                            var day = all_date[2];
                            if (day.length == 1) {
                                day = '0' + day;
                            }
                            if (month.length == 1) {
                                month = '0' + month;
                            }

                            var maskText = $find("<%= txtDateApproved.ClientID %>");
                            maskText.set_value(day + month + year);
                            tooltip.hide();
                        }
            }
            function OnCalendarDateApprovedClick(calendarInstance, args) {
                var tooltip = $find("<%= ToolTipDateApproved.ClientID %>");
                var fastNavigation = calendarInstance._getFastNavigation();
                var date = args.get_renderDay().get_date().toString();
                var all_date = date.split(",");
                var year = parseInt(all_date[0]) + 543;
                var month = all_date[1];
                var day = all_date[2];
                if (day.length == 1) {
                    day = '0' + day;
                }
                if (month.length == 1) {
                    month = '0' + month;
                }

                var maskText = $find("<%= txtDateApproved.ClientID %>");
                maskText.set_value(day + month + year);
                tooltip.hide();
            }
            function OnCalendarDateApprovedViewChanged(sender, step) {
                var year = parseInt(sender.FocusedDate[0]) + 543;
                var month = sender.FocusedDate[1];
                document.getElementById("CalendarDateApproved_Title").innerHTML = changeMonthNumberToName(month) + " " + year;
            }
        </script>        
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">    
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadManager1" />
                    <telerik:AjaxUpdatedControl ControlID="panelList" />
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="AddNewSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="panelCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" />
                    <telerik:AjaxUpdatedControl ControlID="panelList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Delete">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
             <telerik:AjaxSetting AjaxControlID="panelList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelList" />
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                    <telerik:AjaxUpdatedControl ControlID="panelGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Grid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                    <telerik:AjaxUpdatedControl ControlID="panelList" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Height="100%" Width="75px" Transparency="50">
        <table style="height: 100%; width: 100%" border="0">
            <tr>
                <td width="100%" align="center" valign="middle">
                    <img alt="Loading..." 
                        src="../Images/Buttons/loading.gif" 
                        style="border: 0px;" />
                </td>
            </tr>
        </table>
    </telerik:RadAjaxLoadingPanel>
    <table>
        <tr>
            <td>
                <div class="moduleDivSlim1000">
                <div class="moduleDivBottom1000">
                <table>
                    <tr>
                        <td width = "100px" align = "right">
                            ประเภทบุคลากร :
                        </td>
                        <td>
                            <telerik:RadComboBox 
                                ID="cmbEmpType" 
                                DataTextField = "Name"
                                DataValueField = "Sequence"
                                AllowCustomText="true" 
                                runat="server" 
                                Width="200px"
                                Filter ="Contains"
                                AutoPostBack="True"
                                CausesValidation ="false"
                                ValidationGroup = "EmpType"
                                EmptyMessage="... พิมพ์ที่นี่เพื่อช่วยค้นหา ..."                 
                                onselectedindexchanged="cmbEmpType_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </td>
                        <td>
                            สังกัด : 
                        </td>
                        <td>
                            <telerik:RadComboBox 
                                ID="cmbWorkingJobSite" 
                                DataTextField = "job_site_name"
                                DataValueField = "job_site_seq"
                                AllowCustomText="true" 
                                runat="server" 
                                Width="200px"
                                Filter ="Contains"
                                EmptyMessage="... พิมพ์ที่นี่เพื่อช่วยค้นหา ..."
                                OnClientTextChange = "onTextChange" 
                                AutoPostBack="True"
                                onselectedindexchanged="cmbWorkingJobSite_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                </table>
            </div>
            </div>
            </td>
        </tr>
        <tr>
            <td colspan = "4">
                <div class="moduleDivSlim1000">
                <div class="moduleDivBottom1000">
                    <asp:Panel ID="panelCommand" runat="server">                
                        <table cellpadding="0" cellspacing="0">
                            <tr class="command-list">
                                <td class="command-item" style="border: none">
                                    <asp:LinkButton ID="ShowGrid" runat="server" CssClass="LinkButton" onclick="ShowGrid_Click" CausesValidation="false">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/table.gif" />&nbsp;&nbsp;แสดงข้อมูลทั้งหมด
                                    </asp:LinkButton>                        
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="AddNew" runat="server" CssClass="LinkButton" onclick="AddNew_Click">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                    </asp:LinkButton>
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="Edit" runat="server" CssClass="LinkButton"  visible="false" OnClick="Edit_Click">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/Edit.gif" />&nbsp;&nbsp;แก้ไขข้อมูล
                                    </asp:LinkButton>
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="Delete" runat="server" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" OnClick="Delete_Click">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                    </asp:LinkButton>
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="AddNewSave" runat="server" CssClass="LinkButton" Visible="false" onclick="AddNewSave_Click">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/saveDisk.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                    </asp:LinkButton>
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="EditSave" runat="server" CssClass="LinkButton" Visible="false" onclick="EditSave_Click">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/saveDisk.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                    </asp:LinkButton>
                                </td>
                                <td class="command-item">
                                    <asp:LinkButton ID="Cancel" runat="server" CssClass="LinkButton" Visible="false" onclick="Cancel_Click" CausesValidation="false">
                                        <img style="border:0px;vertical-align:middle;" alt="" src="../Images/Buttons/Cancel.gif" />&nbsp;&nbsp;ยกเลิก
                                    </asp:LinkButton>
                                </td>
                            </tr>
                        </table>                            
                    </asp:Panel>
                </div>
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <div class="moduleDivSlim1000">
                <div class="moduleDivBottom1000">   
                <asp:Panel CssClass="panelList" runat="server" ID="panelList" ScrollBars="Auto">                
                <table>
                    <tr>
                        <td width="100%">
                            <ul class="formListItem" id="Ul1">
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ประเภทการลา :
                                            </td>
                                            <td>                                               
                                                <asp:Label runat="server" ID="lblAbsenceType" AssociatedControlID="cmbAbsenceType"></asp:Label>
                                                <telerik:RadComboBox 
                                                    ID="cmbAbsenceType" 
                                                    DataTextField = "Name"
                                                    DataValueField = "Sequence"
                                                    runat="server" 
                                                    AllowCustomText="true" 
                                                    CausesValidation="false" 
                                                    EmptyMessage="... พิมพ์ที่นี่เพื่อช่วยค้นหา ..."                                                                     
                                                    Filter="Contains" 
                                                    OnClientTextChange ="onTextChange"
                                                    Width="200px">
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ชื่อ - นามสกุล :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblEmployee" AssociatedControlID="cmbEmployee"></asp:Label>
                                                <telerik:RadComboBox runat="server" ID="cmbEmployee" 
                                                    Height="230px" Width="350px" 
                                                    AllowCustomText="true" 
                                                    Filter = "Contains"
                                                    EnableTextSelection = "true"            
                                                    ShowDropDownOnTextboxClick="true"
                                                    EmptyMessage=".. พิมพ์ที่นี่เพื่อช่วยค้นหา .." 
                                                    HighlightTemplatedItems = "true"
                                                    MarkFirstMatch="false" 
                                                    ShowMoreResultsBox="true" 
                                                    EnableLoadOnDemand="true" 
                                                    EnableVirtualScrolling="true"  
                                                    OnClientTextChange="onTextChange" ZIndex="8001" 
                                                    CausesValidation = "false" 
                                                    onitemsrequested="cmbEmployee_ItemsRequested" >
                                                    <HeaderTemplate>
                                                        <table cellpadding="0" cellspacing="0" width = "350">
                                                            <tr>
                                                                <td width="150px" align="center"><b>ชื่อ - นามสกุล</b></td>
                                                                <td width="100px" align="center"><b>ตำแหน่ง</b></td>
                                                                <td width="100px" align="center"><b>ระดับ</b></td>                                                    
                                                            </tr>
                                                        </table>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Table id="tableEmployee" runat="server" CellPadding="0" CellSpacing="0">
                                                        </asp:Table>
                                                    </ItemTemplate>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>   
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                เนื่องจาก :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblReason" AssociatedControlID="txtReason"></asp:Label>
                                                <asp:TextBox CssClass="TextBox" ID="txtReason" TextMode ="MultiLine" runat="server" Visible="false" Width="300px"></asp:TextBox>                                                
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ตั้งแต่วันที่ :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblDateStart" AssociatedControlID="txtDateStart"></asp:Label>
                                                <telerik:RadMaskedTextBox ID="txtDateStart" runat="server" Mask=" ##/##/####" Width="75px" TextWithLiterals=" //" SelectionOnFocus="SelectAll"></telerik:RadMaskedTextBox>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="LinkButton">
                                                    <img alt="" src="../Images/Buttons/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                </asp:LinkButton>
                                                <telerik:RadToolTip ID="ToolTipDateStart" runat="server" 
                                                    Animation="None" HideEvent="LeaveToolTip" 
                                                    Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                    TargetControlID="LinkButton1" Modal="true">
                                                    <telerik:RadCalendar id="CalendarDateStart" runat="server" 
                                                        TitleFormat="MMMM yyyy" 
                                                        EnableMultiSelect="false" 
                                                        UseRowHeadersAsSelectors="false" 
                                                        UseColumnHeadersAsSelectors="false" 
                                                        DayCellToolTipFormat="dddd, dd MMMM, yyyy" 
                                                        NavigationPrevToolTip="เดือนก่อนหน้า" 
                                                        NavigationNextToolTip="เดือนถัดไป" 
                                                        FastNavigationNextToolTip="3 เดือนถัดไป" 
                                                        FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                        <ClientEvents OnDateClick="OnCalendarDateStartClick" 
                                                            OnCalendarViewChanged="OnCalendarDateStartViewChanged">
                                                        </ClientEvents>
                                                        <FastNavigationSettings EnableTodayButtonSelection="true" 
                                                            TodayButtonCaption="ไปที่วันนี้" 
                                                            OkButtonCaption="เปลี่ยน" 
                                                            CancelButtonCaption="ยกเลิก" />
                                                    </telerik:RadCalendar>
                                                </telerik:RadToolTip>
                                            </td>
                                            <td width = "120px" align = "right">
                                                ช่วงเวลา :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblStartTime" AssociatedControlID="rdoStartTime"></asp:Label>                                                
                                                <asp:RadioButtonList ID="rdoStartTime" runat="server" RepeatDirection="Horizontal">
                                                    <asp:ListItem Selected="True" Value="M">เช้า</asp:ListItem>
                                                    <asp:ListItem Value="A">บ่าย</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ถึงวันที่ :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblDateEnd" AssociatedControlID="txtDateEnd"></asp:Label>
                                                <telerik:RadMaskedTextBox ID="txtDateEnd" runat="server" Mask=" ##/##/####" Width="75px" TextWithLiterals=" //" SelectionOnFocus="SelectAll"></telerik:RadMaskedTextBox>
                                                <asp:LinkButton ID="LinkButton2" runat="server" CssClass="LinkButton">
                                                    <img alt="" src="../Images/Buttons/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                </asp:LinkButton>
                                                <telerik:RadToolTip ID="ToolTipDateEnd" runat="server" 
                                                    Animation="None" HideEvent="LeaveToolTip" 
                                                    Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                    TargetControlID="LinkButton2" Modal="true">
                                                    <telerik:RadCalendar id="CalendarDateEnd" runat="server" 
                                                        TitleFormat="MMMM yyyy" 
                                                        EnableMultiSelect="false" 
                                                        UseRowHeadersAsSelectors="false" 
                                                        UseColumnHeadersAsSelectors="false" 
                                                        DayCellToolTipFormat="dddd, dd MMMM, yyyy" 
                                                        NavigationPrevToolTip="เดือนก่อนหน้า" 
                                                        NavigationNextToolTip="เดือนถัดไป" 
                                                        FastNavigationNextToolTip="3 เดือนถัดไป" 
                                                        FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                        <ClientEvents OnDateClick="OnCalendarDateEndClick" 
                                                            OnCalendarViewChanged="OnCalendarDateEndViewChanged">
                                                        </ClientEvents>
                                                        <FastNavigationSettings EnableTodayButtonSelection="true" 
                                                            TodayButtonCaption="ไปที่วันนี้" 
                                                            OkButtonCaption="เปลี่ยน" 
                                                            CancelButtonCaption="ยกเลิก" />
                                                    </telerik:RadCalendar>
                                                </telerik:RadToolTip>
                                            </td>
                                            <td width = "120px" align = "right">
                                                ช่วงเวลา :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblEndTime" AssociatedControlID="rdoEndTime"></asp:Label>                                                
                                                <asp:RadioButtonList ID="rdoEndTime" runat="server" RepeatDirection="Horizontal">
                                                    <asp:ListItem Selected="True" Value="M">เช้า</asp:ListItem>
                                                    <asp:ListItem Value="A">บ่าย</asp:ListItem>
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                เป็นระยะเวลา :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblCountDate" AssociatedControlID="txtCountDate"></asp:Label>
                                                <asp:TextBox CssClass="TextBox" ID="txtCountDate" TextMode ="MultiLine" runat="server" Visible="false" Width="100px"></asp:TextBox>  
                                                วัน                                              
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ที่อยู่ติดต่อระหว่างลา :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblContactAddress" AssociatedControlID="txtContactAddress"></asp:Label>
                                                <asp:TextBox CssClass="TextBox" ID="txtContactAddress" TextMode ="MultiLine" runat="server" Visible="false" Width="300px"></asp:TextBox>                                                
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                ผู้อนุมัติ :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblApprover" AssociatedControlID="cmbApprover"></asp:Label>
                                                <telerik:RadComboBox ID="cmbApprover" runat="server" 
                                                    Height="200px" Width="200px"
                                                    DropDownWidth="350px" 
                                                    LoadingMessage = "โหลดข้อมูล"
                                                    EmptyMessage="...พิมพ์ที่นี่เพื่อช่วยค้นหา..." 
                                                    HighlightTemplatedItems="true"
                                                    EnableLoadOnDemand="true" 
                                                    EnableTextSelection = "true"
                                                    onitemsrequested="cmbApprover_ItemsRequested">
                                                    <HeaderTemplate>
                                                        <table cellpadding="0" cellspacing="0" width = "350">
                                                            <tr>
                                                                <td width="150px" align="center"><b>ชื่อ - นามสกุล</b></td>
                                                                <td width="100px" align="center"><b>ตำแหน่ง</b></td>
                                                                <td width="100px" align="center"><b>ระดับ</b></td>                                                    
                                                            </tr>
                                                        </table>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <asp:Table id="tableApprover" runat="server" CellPadding="0" CellSpacing="0">
                                                        </asp:Table>
                                                    </ItemTemplate>
                                                </telerik:RadComboBox>                                                
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div class="formList-detail">
                                    <table>
                                        <tr>
                                            <td width = "120px">
                                                สถานะใบลา :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblStatus" AssociatedControlID="cmbStatus"></asp:Label>
                                                <telerik:RadComboBox
                                                    runat="server" ID="cmbStatus"
                                                    AutoPostBack="true"
                                                    EmptyMessage = "...สถานะใบลา..."
                                                    Width="200px">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="อยู่ระหว่างการพิจารณา" Value="W" Selected="true"></telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem Text="อนุมัติ" Value="A"></telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem Text="ไม่อนุมัติ" Value="E"></telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem Text="ยกเลิก" Value="C"></telerik:RadComboBoxItem>
                                                    </Items>
                                                </telerik:RadComboBox>                                                
                                            </td>
                                            <td width = "120px" align = "right">
                                                วันที่อนุมัติ :
                                            </td>
                                            <td>
                                                <asp:Label runat="server" ID="lblDateApproved" AssociatedControlID="txtDateApproved"></asp:Label>
                                                <telerik:RadMaskedTextBox ID="txtDateApproved" runat="server" Mask=" ##/##/####" Width="75px" TextWithLiterals=" //" SelectionOnFocus="SelectAll"></telerik:RadMaskedTextBox>
                                                <asp:LinkButton ID="LinkButton3" runat="server" CssClass="LinkButton">
                                                    <img alt="" src="../Images/Buttons/Calendar.gif" style="border:0px;vertical-align:middle;" />
                                                </asp:LinkButton>
                                                <telerik:RadToolTip ID="ToolTipDateApproved" runat="server" 
                                                    Animation="None" HideEvent="LeaveToolTip" 
                                                    Position="MiddleRight" ShowEvent="OnClick" Skin="Telerik" 
                                                    TargetControlID="LinkButton3" Modal="true">
                                                    <telerik:RadCalendar id="CalendarDateApproved" runat="server" 
                                                        TitleFormat="MMMM yyyy" 
                                                        EnableMultiSelect="false" 
                                                        UseRowHeadersAsSelectors="false" 
                                                        UseColumnHeadersAsSelectors="false" 
                                                        DayCellToolTipFormat="dddd, dd MMMM, yyyy" 
                                                        NavigationPrevToolTip="เดือนก่อนหน้า" 
                                                        NavigationNextToolTip="เดือนถัดไป" 
                                                        FastNavigationNextToolTip="3 เดือนถัดไป" 
                                                        FastNavigationPrevToolTip="3 เดือนก่อนหน้า">
                                                        <ClientEvents OnDateClick="OnCalendarDateApprovedClick" 
                                                            OnCalendarViewChanged="OnCalendarDateApprovedViewChanged">
                                                        </ClientEvents>
                                                        <FastNavigationSettings EnableTodayButtonSelection="true" 
                                                            TodayButtonCaption="ไปที่วันนี้" 
                                                            OkButtonCaption="เปลี่ยน" 
                                                            CancelButtonCaption="ยกเลิก" />
                                                    </telerik:RadCalendar>
                                                </telerik:RadToolTip>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                
                            </ul>
                        </td>
                    </tr>
                    </table>                
                </asp:Panel>
                </div>
                </div>
            </td>
        </tr>
           <tr>
            <td colspan = "4">
                <div class="moduleDivSlim1000x450">
                <div class="moduleDivBottom1000">
                <asp:Panel CssClass="panelGrid" ID="panelGrid" runat="server" ScrollBars="Auto" Visible="true">                
                <div align="center">
                    <telerik:RadGrid ID="Grid" 
                        runat="server" 
                        AutoGenerateColumns="false"
                        AllowMultiRowEdit="false" 
                        AllowMultiRowSelection="true" 
                        ShowStatusBar="true"
                        Width="950px"
                        AllowPaging="true" 
                        AllowFilteringByColumn="false"
                        GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                        GroupingSettings-GroupContinuedFormatString=""
                        GroupingSettings-GroupContinuesFormatString=""
                        GroupingSettings-GroupSplitFormat="" PageSize ="7" 
                        OnItemCommand="Grid_ItemCommand" align ="left">
                        <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" GroupLoadMode="Client"
                        ShowGroupFooter="true" 
                        DataKeyNames="absence_seq" 
                        ClientDataKeyNames = "absence_seq"
                        NoMasterRecordsText="< ไม่มีข้อมูล >" 
                        GroupsDefaultExpanded="true">
                        <CommandItemTemplate>
                                    <table width="100%">
                                        <tr>
                                                   <td align="right">
                                                
                                            </td>
                                        </tr>
                                    </table>
                                </CommandItemTemplate>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <Columns>   
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="DataDelete" 
                                ConfirmDialogType="RadWindow" ConfirmText="ลบข้อมูลที่เลือก?" 
                                Text="คลิกเพื่อลบข้อมูล" UniqueName="column1">
                                <HeaderStyle HorizontalAlign="Center" Width="5%" />
                                <ItemStyle HorizontalAlign="Center" Width="5%" />
                            </telerik:GridButtonColumn>
                            <telerik:GridTemplateColumn DataField="absence_seq"  
                                HeaderText="เลขที่ใบลา"
                                AutoPostBackOnFilter="true" 
                                AllowFiltering = "true"
                                CurrentFilterFunction="Contains" 
                                ShowFilterIcon="false"
                                FilterControlWidth="100%" 
                                UniqueName="absence_seq" >
                                <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                <ItemStyle HorizontalAlign="Left" />
                                <ItemTemplate>
                                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# Eval("absence_seq","return SeqClick( {0} );") %>' Text='<%# Eval("absence_seq") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn 
                                DataField="pos_ref" 
                                HeaderText="เลขที่ตำแหน่ง" 
                                UniqueName="pos_ref"                     
                                FilterControlWidth="100%"
                                AutoPostBackOnFilter="true" 
                                CurrentFilterFunction="Contains" 
                                HeaderStyle-HorizontalAlign = "Center"
                                ShowFilterIcon="False">
                                <HeaderStyle Width = "90px" />
                                <ItemStyle HorizontalAlign = "Center" Width = "90px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="full_name" 
                                HeaderText="ชื่อ - นามสกุล" 
                                UniqueName="full_name"  
                                FilterControlWidth="100%" 
                                AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains"
                                HeaderStyle-HorizontalAlign = "Center" 
                                HeaderStyle-Width = "150px"
                                ItemStyle-Width = "150px"
                                ShowFilterIcon="False">
                            </telerik:GridBoundColumn>    
                            <telerik:GridBoundColumn 
                                DataField="pos_name" 
                                HeaderText="ตำแหน่ง" 
                                UniqueName="pos_name"  
                                FilterControlWidth="100%" 
                                AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains"
                                HeaderStyle-HorizontalAlign = "Center" 
                                HeaderStyle-Width = "150px"
                                ItemStyle-Width = "150px"
                                ShowFilterIcon="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="class_name" 
                                HeaderText="ระดับตำแหน่ง" 
                                UniqueName="class_name"  
                                FilterControlWidth="100%" 
                                AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" 
                                HeaderStyle-HorizontalAlign = "Center"
                                HeaderStyle-Width = "200px"
                                ItemStyle-Width = "200px"
                                ShowFilterIcon="False">
                            </telerik:GridBoundColumn>
                             <telerik:GridBoundColumn 
                                DataField="job_site_name" 
                                HeaderText="สังกัดตามโครงสร้าง<br>กฏกระทรวง" 
                                UniqueName="job_site_name"  
                                FilterControlWidth="100%" 
                                AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" 
                                HeaderStyle-HorizontalAlign = "Center"
                                HeaderStyle-Width = "150px"
                                ItemStyle-Width = "150px"
                                ShowFilterIcon="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn 
                                DataField="working_job_site_name" 
                                HeaderText="สังกัดตามโครงสร้าง<br>การบริหารจัดการภายใน" 
                                UniqueName="working_job_site_name"  
                                FilterControlWidth="100%" 
                                AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" 
                                HeaderStyle-HorizontalAlign = "Center"
                                HeaderStyle-Width = "150px"
                                ItemStyle-Width = "150px"
                                ShowFilterIcon="False">
                            </telerik:GridBoundColumn>   
                         </Columns>               
                        <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                            FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                            NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                            PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                        </MasterTableView>
                        <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                            GroupContinuedFormatString="" GroupContinuesFormatString="" 
                            GroupSplitFormat="" />
                        <ClientSettings EnableRowHoverStyle="True">
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                        </ClientSettings>
                  </telerik:RadGrid>
                </div>            
            </asp:Panel>
            </div>
            </div>
            </td>
        </tr>
    </table>
    <asp:Panel ID="panelHidden" runat="server">
        <asp:HiddenField ID="hdSequence" runat="server" Value="" />
    </asp:Panel>
</asp:Content>
